Ext.define('CMS.views.login.LoginWin', {
    extend: 'Ext.window.Window',

    requires:[
        'CMS.controllers.login.LoginWinController'
    ],

    xtype: 'LoginWin',
    controller:'LoginWinController',

    autoShow: true,
    height: 200,
    width: 360,
    layout: {
        type: 'fit'
    },
    title:'欢迎登录',
    iconCls: 'fa fa-key fa-lg',
    closeAction: 'hide',
    closable: false,
    draggable: false,
    resizable: false,

    items: [
        {
            xtype: 'form',
            reference:'form',
            bodyPadding: 15,
            defaults: {
                xtype: 'textfield',
                anchor: '100%',
                labelWidth: 70,
                allowBlank: false,
                msgTarget: 'side',
                listeners:{
                    specialKey:'onEnterPress'
                }
            },
            items: [
                {
                    name: 'username',
                    fieldLabel: '用户名',
                    minLength: 3,
                    maxLength: 25,
                    vtype: 'alphanum'
                },
                {
                    inputType: 'password',
                    name: 'password',
                    fieldLabel: '密码',
                    minLength: 5,
                    maxLength: 20
                }
            ]
        }
    ],
    dockedItems:[
        {
            xtype:'toolbar',
            dock:'bottom',
            items:[
                '->',
                {
                    xtype:'button',
                    iconCls:'fa fa-sign-in fa-lg',
                    text:'登陆',
                    formBind:true,
                    handler:'onSubmitButtonClick'
                },
                {
                    xtype:'button',
                    iconCls:'fa fa-sign-in fa-lg',
                    text:'注册',
                    formBind:false,
                    handler:'onRegisterButtonClick'
                }
            ]
        }
    ]


})